package com.slipper.sfts.broker.front;

import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.sfts.api.broker.bo.BrokerBO;
import com.slipper.sfts.api.broker.service.IBrokerSv;
import com.slipper.sfts.broker.service.BrokerService;

import java.util.List;

@RestController
public class BrokerSv implements IBrokerSv {
    @Resource
    private BrokerService brokerService;
    
    @Override
    public Result<BrokerBO> queryBy(String id) {
        return ResultUtil.successResult(brokerService.queryBy(id));
    }

    @Override
    public Result<List<BrokerBO>> queryList(BrokerBO bo) {
        return ResultUtil.successResult(brokerService.queryList(bo));
    }
    
    @Override
    public Result<List<BrokerBO>> queryPage(BrokerBO bo) {
        return ResultUtil.successResult(brokerService.queryPage(bo));
    }
    
    @Override
    public Result<?> save(BrokerBO bo) {
        return ResultUtil.saveResult(brokerService.save(bo), bo);
    }
    
    @Override
    public Result<?> delete(BrokerBO bo) {
        return ResultUtil.deleteResult(brokerService.delete(bo));
    }
}
